use axum::Router;

use crate::error::AppErr;

use super::utils::Cbor;

mod system;
mod robot;
mod cp;

pub type CborRet<T> = Result<Cbor<T>, AppErr>;

pub fn cbor_ok<T>(value: T) -> CborRet<T> {
    Ok(Cbor(value))
}

pub fn register() -> Router {
    Router::new()
        .nest("/system", system::register())
        .nest("/robot", robot::register())
        .nest("/cp", cp::register())
}



